<?php

namespace App\Controllers;

use App\Requests\MiniLoginRequest;
use App\Services\AuthService;
use Carbon\Carbon;
use Framework\BaseController;
use Illuminate\Http\Request;
use Kra8\Snowflake\Snowflake;

class AuthController extends BaseController
{


    /**
     * 小程序登录
     * @param Request $request
     * @param AuthService $service
     * @return \Illuminate\Http\JsonResponse
     */
    public function minlogin(MiniLoginRequest $request,AuthService $service)
    {
        $code = $request->code();
        $shared_user_id = $request->input('scene');
        $iv = $request->iv();
        $encryptedData = $request->encryptedData();
        $res = $service->minlogin($code,$shared_user_id,$iv,$encryptedData);
        return $this->retSuccess($res);
    }

}
